import turtle
import math

def draw_square(pen, x, y, length):
    pen.penup()
    pen.goto(x - length / 2, y - length / 2)
    pen.pendown()
    for _ in range(4):
        pen.forward(length)
        pen.left(90)

def draw_board(pen):
    pen.color('black')
    pen.pensize(1)
    
    for i in range(3):
        for j in range(2):
            length = 50 * (i + 1)
            draw_square(pen, -length / 2 + length * j, -length / 2, length)
        
    for j in range(2):
        length = 50 * (j + 1)
        draw_square(pen, -150 / 2 + 150 * j, -150 / 2 + 150 * j, length)
        a1 = math.sqrt(length * length + length * length)
        pen.penup()
        pen.goto(-75 + 150 * j, 150 / 2 + 150 * j)
        pen.pendown()
        pen.setheading(-45)
        pen.forward(a1)
        
    pen.color('red')
    pen.pensize(3)
    draw_square(pen, -50, -50, 100)
    draw_square(pen, 100, -50, 100)

canvas = turtle.Screen()
pen = turtle.Turtle()
draw_board(pen)
canvas.exitonclick()
